<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Open Server Platform Administrative System</title>
    <script src="jquery.js" type="text/javascript"></script>
    <script type="text/javascript">//<![CDATA[
      $(document).ready(
			function() {
			    $("#shutdown").click(function() {
				    $.get("app/osp_web/clusterwide", {operation: "shutdown"}, function(data) { $("#output").append("<br />" + data); });
				});
			    $("#stats").click(function() {
				    $.get("app/osp_web/clusterwide", {operation: "stats"}, function(data) { $("#output").append("<br />" + data); });
				});
			    $("#nodes").load("app/osp_web/clusterwide?operation=nodes");
			    $("#uptime").load("app/osp_web/clusterwide?operation=uptime");
			});
    //]]></script>
    <link rel="stylesheet" href="style.css" type="text/css" />
    <meta name="keywords" content="erlang, open server platform" />
    <meta name="author" content="Jacob Torrey" />
    <meta name="description" content="The homepage for the OSP administration panel" />
  </head>
  <body>
    <div id="header">
      <p>Welcome Administrator<br />
      <script type="text/javascript">document.write(new Date());</script></p>
    </div>
    <div id="nav">
      <ul>
	<li><a href="index.html">Overview</a></li>
	<li><a href="app.html">Applications</a></li>
	<li><a href="compile.html">Upload Servlet</a></li>
      </ul>
    </div>
    <div id="content">
      <h1 class="center underline">Cluster-Wide Overview</h1>
      <div id="control">
	<h3 class="center">Cluster Controls</h3>
	<p class="indent bold">Please select an action:<br /></p>
	<ul>
	  <li><button id="shutdown">Shutdown Entire Cluster</button></li>
	  <li><button id="stats">Real-time Cluster Stats</button></li>
	</ul>
	<p class="indent bold">Server response:</p>
	<div id="output">
	</div>
      </div>
      <div id="status">
	<h3 class="center">Cluster Status</h3>
	<ul>
	  <li>Uptime - <span id="uptime"></span></li>
	  <li>Number of nodes - <span id="nodes"></span></li>
	</ul>
      </div>
    </div>
    <div id="footer">
      <hr />
      <p class="center">&copy; 2009 Jacob Torrey</p>
    <p class="center"><a href="http://www.openserverplatform.com">Open Server Platform Home</a></p>
  </div>
</body>
</html>
